package cn.lysj.framework.coupon.controller;

import cn.lysj.framework.base.BaseController;
import cn.lysj.framework.common.annotation.CurrentUser;
import cn.lysj.framework.common.domain.User;
import cn.lysj.framework.common.utils.pagination.PageVo;
import cn.lysj.framework.common.utils.web.Resp;
import cn.lysj.framework.coupon.domain.NewVipCouponConfig;
import cn.lysj.framework.coupon.service.NewVipCouponConfigService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @author zwj
 * @description 新加入会员优惠券配置控制层
 * @create 2019-01-16 09:37:56
 **/
@Slf4j
@RestController
@Api(description = "新加入会员优惠券配置管理接口")
@RequestMapping("/new_vip_coupon_config")
public class NewVipCouponConfigController extends BaseController<NewVipCouponConfig>{

    @Resource
    private NewVipCouponConfigService newVipCouponConfigService;

    @Override
    public NewVipCouponConfigService getService() {
        return newVipCouponConfigService;
    }

    @Override
    public Resp list(NewVipCouponConfig entity, PageVo pageVo){
        return null;
    }

    @Override
    public Resp update(NewVipCouponConfig entity){
        return null;
    }

    @Override
    public Resp save(NewVipCouponConfig entity){
        return null;
    }

    @GetMapping("/list_rewrite")
    public Resp listRewrite(@CurrentUser User user){
        return newVipCouponConfigService.storeGetNewVipCoupon(user.getStoreId());
    }

    @PostMapping("/add_new_vip_coupon_config")
    public Resp addBirthdayCouponConfig(@CurrentUser User user,String[] couponIds ){
        return newVipCouponConfigService.addNewVipCouponConfig(user.getStoreId(),couponIds);
    }

    @PostMapping("/delete_new_vip_coupon_config")
    public Resp deleteNewVipCouponConfig(@CurrentUser User user,String newVipCouponConfigId){
        return newVipCouponConfigService.deleteNewVipCouponConfig(user.getStoreId(),newVipCouponConfigId);
    }




}
